package com.why.mapper;

import com.github.pagehelper.Page;
import com.why.dto.ArticlePageDTO;
import com.why.pojo.Article;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
* @author 王-自信
* @description 针对表【article】的数据库操作Mapper
* @createDate 2024-11-26 16:06:48
* @Entity com.why.pojo.Article
*/
public interface ArticleMapper extends BaseMapper<Article> {

    @Insert("insert into article(title,content,cover_img,state,category_id,create_user,create_time,update_time) " +
            "values (#{article.title},#{article.content},#{article.coverImg},#{article.state},#{article.categoryId},#{uid},now(),now())")
    void add( Article article, Integer uid);


    Page<Article> pageQuery(ArticlePageDTO articlePageDTO);



    void updateArticle(Article article);
}




